var admin_user = {};
admin_user.act_filter = function(frm_id) {
    if (frm_id == null || frm_id == undefined) {
        $("#frm_user_search").submit();
    } else {
        $("#" + frm_id).submit();
    }
    return false;
};
admin_user.reset_filters = function(frm_id) {
    $("#" + frm_id).find("textarea, select, input:text").val(null);
    admin_user.act_filter();
    return false;
};

admin_user.go_page = function(obj) {
    var page = $(obj).text();
    if (page == null || page == undefined) {
        page = 1;
    }
    $("#current_page").val(page);
    return admin_user.act_filter();
};

admin_user.first_page = function() {
    $("#current_page").val(1);
    return admin_user.act_filter();
};

admin_user.prev_page = function() {
    var page = parseInt($("#current_page").val());
    page--;
    $("#current_page").val(page);
    return admin_user.act_filter();
};

admin_user.next_page = function(last_page) {
    var page = parseInt($("#current_page").val());
    page++;
    if (page > last_page) {
        return false;
    }
    $("#current_page").val(page);
    return admin_user.act_filter();
};

admin_user.last_page = function(page) {
    $("#current_page").val(page);
    return admin_user.act_filter();
};

admin_user.show_img_path = function(checked) {
    if (checked) {
        $("#wp_img_path").show();
        $("#wp_img_path input").focus();
    } else {
        $("#wp_img_path").hide();
    }
};


